
<a href="#top" id="toTop"></a>
<h1>CPAGRIP</h1>
<?php
	$feedurl = "http://www.cpagrip.com/common/offer_feed_rss.php?user_id=$banner->pubIdOrAppId&key=$banner->passOrSecretKey&ip=".$_SERVER['REMOTE_ADDR'].'&tracking_id='.urlencode($this->session->userdata('username'));

	if($xml = simplexml_load_file($feedurl, 'SimpleXMLElement', LIBXML_NOCDATA)) { ?>

		<ul id="list-offers">

			<?php foreach($xml->offers->offer as $offeritem) { 
				$points = floatval($offeritem->payout) * 100 * $banner->ratio;
				?>

				<li>
					<a  href='<?php echo $offeritem->offerlink; ?>' target="_blank" class"offer">
						<div class="offer-image">
							<img src='<?php echo $offeritem->offerphoto; ?>' />
						</div><!-- .\offer-image -->

						<div class="offer-content">
							<h3 class="offer-name"><?php echo $offeritem->title; ?></h3>
							<?php echo substr($offeritem->description, 0, 122); ?>
						</div><!-- \.offer-content -->

						<div class="offer-payout">
							<h3 class="points">
								<strong>+<?php echo $points; ?></strong> 
								point
							</h3>
						</div><!-- \.offer-payout -->
					</a>
				</li>

			<?php } ?>

		</ul>
	<?php }else{
		echo 'no offer available';
	}
?>